<?php 
$sql = "Select * from mode";
$query = $this->db->query($sql);
$result = $query->row();

$mode = $result;

?>				
					<form role="form" method="POST"
						action="<?= base_url();?>member/tips_submit">
							<div class="form-group">
								<table class="table table-hover">

								<?php if($business){?>
				<thead>
				
					<tr>

						<th>Business Title</th>
						<?php if($mode->mode == "TRUE"){?>
                        <th>Business Plan</th>
                        <?php }?>
                        <th>Status</th>
						<th>Action</th>
					</tr>
				</thead>
				<tbody>
				
				<?php foreach($business as $business):?>

				
                    <?php
                    $plan = getPK('membership',$business->plan);
                    $plan = $plan['name'];
                    ?>
					<tr>

						<td><?= $business->title;?></td>
						<?php if($mode->mode == 'TRUE'){?>
                         <td>
                             <?php if($plan){?>
                             <div class="badge"><?=  $plan;?></div> <a class="btn btn-warning btn-xs" href="<?= base_url();?>member/business/change/<?= $business->id;?>"> Change Plan </a>
                               <?php }?>
                         </td>
                         <?php }?>
                        <td>

						<?php if($business->status == "51"){?>
						<div class="badge">
						Active
						</div>
						<?php }else{?>
						<div class="badge">
						Inactive
						</div>
						
						<?php }?>
						</td>
						<th>
						
						<?php if($business->status == '51'){?>
						<?php 
						
						$c = $this->term_model->getTermValue($business->id,'city',1);
						
						if($c){
						
							$loc = getPK('location',$c);
						
						
						
							//var_dump($loc);die();
							//die("YES");
							$loc = seoUrl($loc['name']);
						}else{
						
							$loc =  config_item('country');
						
							$loc = seoUrl($loc);
						}
						
						
						$cat = getPK('category',$this->term_model->getTermValue($business->id,'keyword',1));
						$cat = seoUrl($cat['name']);
						?>
						
						<a data-toggle="tooltip" title="View" href="<?= base_url().$loc."/".$cat."/".$business->slug."-".$business->id; ?>"
							target="_BLANK"class="btn btn-default btn-xs"><span
								class="glyphicon glyphicon-folder-open"></span> </a>
								<?php }?> 
						<a data-toggle="tooltip" title="Edit" href="<?= base_url();?>member/business/edit/<?= $business->id;?>"
							class="btn btn-default btn-xs"><span
								class="glyphicon glyphicon-pencil"></span> </a> 
								<a data-toggle="tooltip" title="Logo" href="<?= base_url();?>member/business/logo/<?= $business->id;?>"
							class="btn btn-default btn-xs"><span
								class="glyphicon glyphicon-camera"></span> </a>
								<input type="hidden" name="post_id" id="post_id" value="<?= $business->id;?>">
								<a data-toggle="tooltip" title="Photo" href="<?= base_url();?>member/business/photo/<?= $business->id;?>"
							class="btn btn-default btn-xs"><span
								class="glyphicon glyphicon-picture"></span> </a>
								
								<a data-toggle="tooltip" title="Video" href="<?= base_url();?>member/business/video/<?= $business->id;?>"
							class="btn btn-default btn-xs"><span
								class="glyphicon glyphicon-facetime-video"></span> </a>
								<a
							data-toggle="tooltip" title="Delete" href="#" <?php if($this->config->item('mode')=='DEMO'){?>onclick="alert ('Sorry! Not allowed in demo mode '); return false;" <?} else?>onclick="return confirm('Are you sure ?');">
							<i class="btn btn-default btn-xs"><span
								class="glyphicon glyphicon-trash"></span> </a></th>


					</tr>
					<?php endforeach;?>
					
					<?php }else{?>
					<div class="alert alert-danger">Oops! No data found..</div>
					<?php }?>
							</tbody>
			</table>
							</div>
				
			
			</form>
			